<template>
	<view class="count">
		<view class="btnBg b-r-15 f f-a-c f-j-b">
			<view class="avactTit">
				昵称
			</view>
			<view class="avactImg f f-a-c">
				<input type="nickname" class="inp" @change="changeFn" v-model="value">
				<image src="/static/my/you.png" class="rightImg" mode=""></image>
			</view>
		</view>
		<view @click="comig" class="btnSubmit">
			确定
		</view>
		<view @click="skip" class="cancel">
			跳过
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				value: '昵称'
			}
		},
		methods: {
			async skip() {
				// let n = await this.$api.ProfilePost({
				// 	nickname: this.value,
				// })
				// this.$msg(n.msg)
				setTimeout(() => {
					uni.navigateTo({
						url: '/pageA/Introduction'
					})
				}, 500)
			},
			async comig() {
				let n = await this.$api.ProfilePost({
					nickname: this.value,
				})
				this.$msg(n.message)
				setTimeout(() => {
					uni.navigateTo({
						url: '/pageA/Introduction'
					})
				}, 500)
			},
			// /点击确认后发请求请求之后跳转主页面
			async changeFn(e) {
				console.log(e);
				this.value = e.detail.value
				uni.setStorageSync('nickName', e.detail.value)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.inp {
		height: 100%;
		// width: 50%;
		text-align: right;
		padding-right: 0rpx;
		font-size: 30rpx;
	}

	.btnSubmit {
		width: 94%;
		height: 88rpx;
		line-height: 85rpx;
		background: #009d85;
		font-size: 30rpx;
		font-family: PingFang SC, PingFang SC-Bold;
		font-weight: 700;
		text-align: center;
		color: #ffffff;
		margin: 0 auto;
		margin-top: 100rpx;
		border-radius: 44rpx;
	}

	.cancel {
		font-size: 26rpx;
		font-family: PingFang SC, PingFang SC-Medium;
		font-weight: 500;
		text-align: center;
		color: #999999;
		margin-top: 25rpx;
	}

	.btnBg {
		width: 94%;
		padding: 20rpx;
		margin: 0 auto;
		background-color: #fff;
		border: none;
		margin-top: 30rpx;

		.avactImg {
			.imgAct {
				width: 72rpx;
				height: 72rpx;
				background: rgba(0, 0, 0, 0.00);
				border-radius: 50%;
			}

			.rightImg {
				width: 15rpx;
				height: 20rpx;
				margin-left: 15rpx;
			}
		}

		.avactTit {
			font-size: 28rpx;
			font-family: PingFang SC, PingFang SC-Medium;
			font-weight: 500;
			text-align: left;
			color: #666666;
		}
	}
</style>